//
//  ZXBoutiqueSpecialViewModel.m
//  XiMaFM
//
//  Created by fanzhuxian on 2017/9/6.
//  Copyright © 2017年 hcios. All rights reserved.
//

#import "ZXBoutiqueSpecialViewModel.h"

#import "ZXBoutiqueSpecialModel.h"
#import "ZxHomePageNetManager.h"

@implementation ZXBoutiqueSpecialViewModel

- (void)getDataCompletionHandle:(void (^)(NSError *))completed {

    self.dataTask = [ZxHomePageNetManager getBoutiquePageCompletionHandle:^(ZXBoutiqueSpecialModel * responseObject, NSError *error) {
        self.model = responseObject;
        self.categoryContentsArr = responseObject.list;
        self.section = _categoryContentsArr.count;
        completed(error);
    }];
}

#pragma mark - 推荐内容
- (id)modelForSection:(NSInteger)section {
    
    return self.model.list;
}

- (NSString *)mainTitleForSection:(NSInteger)section {
    return self.model.list[section].title;
}

#pragma mark - 给FindPutCell的属性方法
// 图
// 热门推荐 列表(外层需要HotR_List_List* 读取数组中的对象)
- (NSURL *)coverURLForSection:(NSInteger)section index:(NSInteger)index {
    NSString *path = nil;
    
    path =  self.model.list[index].albumCoverUrl290;
    
    return [NSURL URLWithString:path];
}
- (NSString *)titleForSection:(NSInteger)section index:(NSInteger)index {
    
    return self.model.list[index].title;
}
//评分
- (NSInteger)scoreForSection:(NSInteger)section index:(NSInteger)index{
    return self.model.list[index].score;
}
//评论
- (NSInteger)commentsCountForSection:(NSInteger)section index:(NSInteger)index{
    return self.model.list[index].commentsCount;
    
}
//价格
- (NSInteger)priceForSection:(NSInteger)section index:(NSInteger)index{
    return self.model.list[index].price;
    
}
//会员价格
- (NSString *)displayVipPriceForSection:(NSInteger)section index:(NSInteger)index{
    return self.model.list[index].displayVipPrice;
    
}

- (NSString *)trackTitleForSection:(NSInteger)section index:(NSInteger)index {
    
    return self.model.list[index].trackTitle;
    
}
- (NSInteger)albumIdForSection:(NSInteger)section index:(NSInteger)index {
    
    return self.model.list[index].albumId;
    
}

// 集数  -- 跳转页tableView的row
- (NSInteger)tracksForSection:(NSInteger)section index:(NSInteger)index {
    
    return self.model.list[index].tracks;
    
}

- (NSArray *)hotListsModelForSection:(NSInteger)section {
    return self.model.list;
}

@end
